Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Manipulating Translate Transforms

QuickDraw 3D provides routines that you can use to create and manipulate translate transforms. A translate transform translates an object along the x , y , and z axes by specified values.

Q3TranslateTransform_New

You can use the Q3TranslateTransform_New function to create a new translate transform.

TQ3TransformObject Q3TranslateTransform_New (
                     const TQ3Vector3D *translate);
translate
A vector whose three fields specify the desired translation along each coordinate axis.

DESCRIPTION

The Q3TranslateTransform_New function returns, as its function result, a reference to a new transform object of type kQ3TransformTypeTranslate using the data passed in the translate parameter. The transform translates an object by the values in translate->x , translate->y , and translate->z , respectively. The data you pass in the translate parameter is copied into internal QuickDraw 3D data structures. If QuickDraw 3D cannot allocate memory for those structures, Q3TranslateTransform_New returns the value NULL .

Q3TranslateTransform_Submit

You can use the Q3TranslateTransform_Submit function to submit a translate transform without creating an object or allocating memory.

TQ3Status Q3TranslateTransform_Submit (
                     const TQ3Vector3D *translate,
                     TQ3ViewObject view);
translate
A vector whose three fields specify the desired translation along each coordinate axis.
view
A view.

DESCRIPTION

The Q3TranslateTransform_Submit function pushes the translate transform specified by the translate parameter on the view transform stack of the view specified by the view parameter. The function returns kQ3Success if the operation succeeds and kQ3Failure otherwise.

SPECIAL CONSIDERATIONS

You should call this function only in a submitting loop.

Q3TranslateTransform_Get

You can use the Q3TranslateTransform_Get function to query the private data stored in a translate transform.

TQ3Status Q3TranslateTransform_Get (
                     TQ3TransformObject transform,
                     TQ3Vector3D *translate);
transform
A transform.
translate
On entry, a pointer to a vector. On exit, a pointer to a vector whose three fields specify the current translation along each coordinate axis.

DESCRIPTION

The Q3TranslateTransform_Get function returns, in the translate parameter, information about the translate transform specified by the transform parameter. You should use Q3TranslateTransform_Get only with transforms of type kQ3TransformTypeTranslate .

Q3TranslateTransform_Set

You can use the Q3TranslateTransform_Set function to set new private data for a translate transform.

TQ3Status Q3TranslateTransform_Set (
                     TQ3TransformObject transform,
                     const TQ3Vector3D *translate);
transform
A transform.
translate
A vector whose three fields specify the desired translation along each coordinate axis.

DESCRIPTION

The Q3TranslateTransform_Set function sets the translate transform specified by the transform parameter to the data passed in the translate parameter. You should use Q3TranslateTransform_Set only with transforms of type kQ3TransformTypeTranslate .


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |